// 首先引入Mock
const Mock = require('mockjs');

// 设置拦截ajax请求的相应时间
Mock.setup({
    timeout: '200-600'
});

// 拦截用户登录接口，返回默认设定信息
Mock.mock("/api/users/auth", "post", (options) => {
    return {
        userId: "233",
        identity: JSON.parse(options.body).account,
        token: JSON.parse(options.body).account
    }
});

// 拦截token认证接口，默认为agree时候返回认证成功，其他情况认证失败
Mock.mock(RegExp("/api/users/auth\\?.*"), 'get', (options) => {
    // 从url中提取token
    let token = options.url.split('?')[1].split('=')[1];
    if (token) {
        return {
            result: 1,
            identity: token
        }
    }
    return {
        result: token
    }
});

Mock.mock("/api/users/auth", 'get', {
    result: 0
})

// 拦截获取图片验证码的请求，默认只给出一个图片，
Mock.mock("/api/users/authCode", "get", {
    codeId: "5fae938f-60de-4a39-9e7c-16619f14e024",
    pic: "iVBORw0KGgoAAAANSUhEUgAAAKAAAAAoCAIAAAD2TmbPAAAORElEQVR4Xu2b+VsT1xrH54d7n/ZeW2u3R62tbR9vF+vWWrXaerW2pbVW7WYVtXbRKtXrghtoUMGKihuC7GELgSSEkIVA9slsmclkYU1AluCGYPfWP+EeGBiGI2rCYoWnH8/DY77nTBL9nvec9z0zIMSoBsdwWLojNpKEpREOAgujCODutgmbgvc4o8azrqNllHmMwMLoYteUrSaNEVZvwU4SR5rqNrS3qFgG7hvhILAwujg4d682Tw2rfamgHRFXG3ddarA4KLhv5IPAwt3AwJ+Rw9GwQ7KzhbAqQOZhwztaEhpqgl3HRxoILNwR4O5U1z9nu8Ytdj633PnqOueSLfSn++iNRx17zjuO5VApSrLQSFbAl/11nF5zIicmC1Z7OOerWn0jIKl0wx2jCAQW7gbwWE9o5ZQkkzp/hjpyxLEzkt6wiVnxBbNwqXP6QvbpmewYMAnmsk+8y77wCTN3AxO2jVkd7dhy3BGd4kiQUJlqUmkhzPD7Dg+p25JAg9WubHlfoH5TW5OeoeG+0QUCC0MBSti0pKqAFKdSp086RCLH1h302q+ZpZ8557/nfGk+O36a64Fp7IML2InvO6eucr65k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瑜
Mock.mock(RegExp("/users/info\\??.*"), "get", {
    "username": "阿瑜",
    "college": "计算机与通信工程学院",
    "class": "计科184",
    "email": "2426774691@qq.com",
    "phoneNumber": "18600636266",
    "userId": "41824211"        // 学工号
})

// 获取上课时间
Mock.mock("/api/courses/time", 'get', {
    total: 6,
    times: [
        {
            start: "08:00",
            end: "09:35"
        },
        {
            start: "09:55",
            end: "11:30"
        },
        {
            start: "13:30",
            end: "15:05"
        },
        {
            start: "15:20",
            end: "16:55"
        },
        {
            start: "17:10",
            end: "18:45"
        },
        {
            start: "19:30",
            end: "09:05"
        },
    ],
    totalWeek: 16,
    currentSemester: "2020-2021-2",
    semesters: ["2020-2021-1", "2020-2021-2"]
})

// 获取课表

Mock.mock(RegExp("/api/users/table\\?.*"), 'get', {
    "totalWeek": 16,
    "classList": [
        [
            [], [],
            [
                {
                    "name": "compiler",
                    "teacher": "hsy", // 学生专有字段
                    "loc": "逸夫楼203",
                    "num": 2,
                    "duration": "1-16",
                    "isRemind": 1,
                    "id": 3,
                    "class": "计184" // 老师专有字段
                },
                {
                    "name": "计算机体系结构计算机体系结构计算机体系结构计算机体系结构计算机体系结构",
                    "teacher": "公维熙", // 学生专有字段
                    "loc": "逸夫楼203",
                    "num": 2,
                    "duration": "1-16",
                    "class": "计184", // 老师专有字段
                    "isRemind": 0,
                    'id': 1
                }
            ],
            [], [], []
        ],
        [
            [],
            [
                {
                    "name": "计算机体系结构",
                    "teacher": "马亮", // 学生专有字段
                    "loc": "逸夫楼203",
                    "num": 2,
                    "duration": "1-8",
                    "isRemind": 0,
                    "id": 2,
                    "class": "计184" // 老师专有字段
                }
            ],
            [], [], [], []
        ],
        [[], [], [], [], [], []],
        [[], [], [], [], [], []],
        [[], [], [], [], [], []],
        [[], [], [], [], [], []],
        [[], [], [], [], [], []],
    ]
});

// 修改学生手机号和邮箱
Mock.mock("/api/users/info", 'put', {
    result: "ok"
});

// 获取我的上课提醒
Mock.mock("/api/courses/reminder", 'get', {
    result: [
        {
            name: "计算机体系结构",
            id: 111
        },
        {
            name: "计算机体系结构计算机体系结构计算机体系结构计算机体系结构计算机体系结构计算机体系结构计算机体系结构计算机体系结构",
            id: 233
        }
    ]
});

// 删除我的上课提醒
Mock.mock(RegExp("/api/courses/reminder\\?.*"), 'delete', {
    result: "ok"
})
// 添加我的上课提醒
Mock.mock("/api/courses/reminder", 'post', {
    return: "ok"
})
// 密码修改
Mock.mock("/api/users/password?type=change", "put", {
    result: "ok"
})

// 密码重置
Mock.mock("/api/users/password?type=reset", "put", {
    result: "ok"
})

// 查询成绩
Mock.mock("/api/students/score", 'get', {
    scores: [
        {
            semester: "2020-2021-1",
            courseId: "10601831",
            name: "工科数学分析1",
            type: "科学素养",
            classHour: 96,
            credit: 6,
            score: 96
        },
        {
            semester: "2020-2021-1",
            courseId: "10601831",
            name: "工科数学分析1",
            type: "科学素养",
            classHour: 96,
            credit: 6,
            score: 96
        }
    ],
    creditCompulsory: 18,
    creditPublicCompulsory: 12,
    creditMajorCompulsory: 16,
    weightedAverage: 100
});

// 学生获取自己的培养计划
Mock.mock(RegExp("/api/students/trainingPlan\\??.*"), 'get', {
    "trainingPlans": [
        {
            "semester": "2021-2022-2", // 计划学年学期
            "courseId": "308010A", // 课程号
            "name": "计算机体系结构", // 课程名
            "direction": "创新创业", //专业方向
            "type": "教学实践",    // 课程类别
            "classHour": 32, 		// 学时
            "credit": 5,			// 学分
            "optional": "308010A,308010B二选一", // 可选策略
            "remarks": "备注",		// 备注
        },
        {
            "semester": "2021-2022-2", // 计划学年学期
            "courseId": "308010B", // 课程号
            "name": "计算机系统结构", // 课程名
            "direction": "创新创业", //专业方向
            "type": "教学实践",    // 课程类别
            "classHour": 32, 		// 学时
            "credit": 5,			// 学分
            "optional": "308010A,308010B二选一", // 可选策略
            "remarks": "备注",		// 备注
        },
    ],
    "name": "2018级计算机科学与技术(0244)专业教学计划"
});

// 获取学校结构
Mock.mock("/api/users/collegeInfo", 'get', {
    "colleges": [
        {
            "value": 12333,        // 学院id
            "label": "计通学院",    // 学院名称
            "children": [
                {
                    "value": 2333, // 专业id
                    "label": "计算机科学与技术", // 专业名称
                    "children": [
                        {
                            "value": 233,        // 班级id
                            "label": "计科184", // 班级名称
                        }
                    ]
                }
            ]
        }
    ],
    grades: [
        {
            id: 1,
            text: "大一"
        },
        {
            id: 2,
            text: "大二"
        },
        {
            id: 3,
            text: "大三"
        },
        {
            id: 4,
            text: "大四"
        }
    ]
});

// 获取学生列表
Mock.mock(RegExp("/api/cAdmin/students\\?.*"), 'get', (options) => {
    let type;
    for (let o of options.url.split("?")[1].split("&")) {
        var t = o.split("=")
        if (t[0] === "type") {
            type = t[1]
        }
    }
    if (type === "get") {
        return {
            students: [
                {
                    "college": "计通学院",
                    "major": "计算机科学与技术",
                    "class": "计科184",
                    "grade": "大三",
                    "name": "马亮",
                    "studentNumber": "41824208",
                    "gender": "男"
                }, {
                    "college": "计通学院",
                    "major": "计算机科学与技术",
                    "class": "计科184",
                    "grade": "大三",
                    "name": "公维熙",
                    "studentNumber": "41824211",
                    "gender": "男"
                }, {
                    "college": "数理学院",
                    "major": "数学",
                    "class": "数学191",
                    "grade": "大二",
                    "name": "学生甲",
                    "studentNumber": "41234567",
                    "gender": "女"
                }, {
                    "college": "自动化学院",
                    "major": "自动化",
                    "class": "自174",
                    "grade": "大四",
                    "name": "学生乙",
                    "studentNumber": "12345678",
                    "gender": "男"
                },

            ],
            total: 4
        };
    } else {
        return {
            students: [
                {
                    "college": "计通学院",
                    "major": "计算机科学与技术",
                    "class": "计科184",
                    "grade": "大三",
                    "name": "马拉硫磷",
                    "studentNumber": "41824208",
                    "gender": "男"
                }
            ],
            totals: 1
        }
    }

});

// 获取选课状态
Mock.mock("/api/courseSelections?type=status", 'get', () => {
    if (Math.random() > 0.5) {
        return {
            result: true,
            name: "2020-2021-2预选课"
        }
    }
    return {
        result: false
    }
});

// 获取可选择的课程
Mock.mock(RegExp("/api/courses\\?type=canSelected.*"), 'get', () => {
    let courseId = Math.ceil(Math.random() * 100000)
    return {
        "courses": [
            {
                semester: "2020-2021-2",
                courseId: courseId,
                courseName: "信息论与编码B",
                courseType: "本专业选",
                classHour: "48",
                credit: "3",
                status: "未选"
            }
        ]
    }
});

// 获取可选择的讲台接口
Mock.mock(RegExp("/api/platforms\\?type=canSelected.*"), 'get', {
    platforms: [
        {
            semester: "2020-2021-2",
            courseId: 1060122,
            courseName: "计算机体系结构",
            courseType: "必修课",
            credit: 3,
            platformName: "计科184",
            teacher: "马老师",
            time: "周二第二节，周四第一节",
            location: "机电203",
            currentNumber: 23,
            totalNumber: 88,
            deadLine1: "2021-10-28",
            deadLine2: "2021-10-28",
            other: "没有备注",
            sessionId: 12
        }
    ]
})

// 获取已选择的课程接口
Mock.mock("/api/courses?type=selected", 'get', () => {
    let courseId = Math.ceil(Math.random() * 100000)
    return {
        "courses": [
            {
                semester: "2020-2021-2",
                courseId: courseId,
                courseName: "计算机科学与技术",
                courseType: "必修",
                classHour: "48",
                credit: "3",
                status: "已选",
                selectionId: 111
            }
        ]
    }
});

// 选课
Mock.mock("/api/selections", "post", {
    result: "ok"
})

// 退课
Mock.mock(RegExp("/api/selections\\?.*"), 'delete', {
    result: "ok"
})

// 获取选课日志
Mock.mock("/api/selections/logs", 'get', {
    "logs": [
        {
            "semester": "2020-2021-2",
            "type": "个人选课",					// 操作类型
            "courseName": "计算机体系结构",
            "courseType": "必修",					// 课程性质
            "time": "2021-05-22 11:38:06",
            "user": "41824208"					// 操作人
        }
    ]
});

// 获取学业状态
Mock.mock("/api/schoolWork", 'get', {
    creditCompulsory: Math.floor(Math.random() * (20 - 1 + 1)),            // 已获得的必修学分
    totalCompulsory: 20, // 必修共需要学分
    creditPublicOptional: Math.floor(Math.random() * (20 - 1 + 1)),            // 公选学分
    totalPublicOptional: 20,            // 公选共需要的学分
    creditMajorOptional: Math.floor(Math.random() * (20 - 1 + 1)),            // 专选学分,
    totalMajorOptional: 20,            // 专选共需要的学分
    weightedAverage: 100,    // 加权平均
})

// 上传文件
Mock.mock("/api/files", 'post', {
    path: "/static/1.excel"
})

// 导入学生
Mock.mock("/api/students", "post", {
    result: "ok"
})

// 修改培养计划
Mock.mock("/api/students/trainingPlans", 'put', {
    result: "ok"
});

// 新加培养计划
Mock.mock("/api/students/trainingPlans", 'post', {
    result: "ok"
});

// 老师获取自己的课程
Mock.mock("/api/teacher/courses", 'get', () => {
    let courses = []
    for (let i = 0; i < 10; i++) {
        courses.push({
            name: "数据结构",
            courseId: Math.ceil(Math.random() * 100000),
            courseType: "必修课",
            sessionId: Math.ceil(Math.random() * 10000000)
        })
    }
    return {
        courses
    }
})

// 学院教务信息
Mock.mock("/api/cAdmin/administration", "get", () => {
    let educationalAdministration = [];
    for (let i = 0; i < 5; i++) {
        educationalAdministration.push({
            college: "计通学院",
            account: "计通学院教务账户名" + (i + 1),
            password: "12345678"
        })
        educationalAdministration.push({
            college: "自动化学院",
            account: "自动化学院教务账户名" + (i + 1),
            password: "87654321"
        })
        educationalAdministration.push({
            college: "外院",
            account: "外院教务账户名" + (i + 1),
            password: "12348765"
        })
    }
    return {
        educationalAdministration
    }
});

// 获取课程细节
Mock.mock("/api/teacher/courseInfo", "post", {
    startWeek: 1,
    endWeek: 16,
    loc: "逸夫楼203",
    classTime: [
        {
            day: 1,
            class: 1,
        }, {
            day: 3,
            class: 2,
        }
    ]
})

// 查询选课名单
Mock.mock(RegExp("/api/teacher/selection\\?.*"), "get", () => {
    let res = {};
    res["total"] = 30;
    res["nameList"] = [];
    for (let i = 0; i < 30; i++) {
        res["nameList"].push({
            "account": Math.ceil(Math.random() * 100000),
            "studentName": "韩旭" + i + 1,
            "class": "计科" + Math.ceil(Math.random() * 1000),
            "college": "计通学院"
        })
    }
    return res;
})

Mock.mock(RegExp("/api/selections/score\\?.*"), "get", () => {
    let res = {};
    res["sessionName"] = "高等数学";
    res["teacherName"] = "孙玉华";
    res["total"] = 30;
    res["scores"] = [];
    for (let i = 0; i < 30; i++) {
        res["scores"].push({
            "account": Math.ceil(Math.random() * 100000),
            "studentName": "韩旭" + i + 1,
            "score": Math.ceil(Math.random() * 100),
            "usualScore": Math.ceil(Math.random() * 40),
            "examScore": Math.ceil(Math.random() * 100),
        })
    }
    return res;
})

// 接收勘误操作
Mock.mock("/api/selections/errata", "post", (options) => {
    console.log(options)
    return {
        result: true
    }
})

// 接收调课请求
Mock.mock("/api/audition/adjustment", 'post', (options) => {
    console.log(options)
    return {
        result: true
    }
})

// 查询审批操作
Mock.mock("/api/auditions/record", 'get', () => {
    return {
        records: [
            {
                "sessionName": "离散数学",
                "teacherName": "hsy",
                "currentState": "0",//约定数字来判断现在的审批状态
                "auditId": "001"
            },
            {
                "sessionName": "高等数学",
                "teacherName": "tex",
                "currentState": "0",//约定数字来判断现在的审批状态
                "auditId": "002"
            },
            {
                "sessionName": "线性代数",
                "teacherName": "hsy",
                "currentState": "1",//约定数字来判断现在的审批状态
                "auditId": "003"
            },
            {
                "sessionName": "英语",
                "teacherName": "hsy",
                "currentState": "1",//约定数字来判断现在的审批状态
                "auditId": "004"
            },
            {
                "sessionName": "离散数学",
                "teacherName": "hsy",
                "currentState": "2",//约定数字来判断现在的审批状态
                "auditId": "005"
            },
            {
                "sessionName": "毛概",
                "teacherName": "hsy",
                "currentState": "2",//约定数字来判断现在的审批状态
                "auditId": "006"
            },
            {
                "sessionName": "思修",
                "teacherName": "hsy",
                "currentState": "2",//约定数字来判断现在的审批状态
                "auditId": "007"
            },
            {
                "sessionName": "大物",
                "teacherName": "hsy",
                "currentState": "3",//约定数字来判断现在的审批状态
                "auditId": "008"
            },
            {
                "sessionName": "概率论",
                "teacherName": "hsy",
                "currentState": "-1",//约定数字来判断现在的审批状态
                "auditId": "009"
            }
        ]

    }
})

// 查询详细审批信息
Mock.mock(RegExp("/api/auditions/auditInfo\\?.*"), "get", (options) => {
    console.log(options);
    return {
        "sessionName": "离散数学",
        "teacherName": "hsy",
        "description": "this is a case",
        "originWeek": "1",
        "originDay": "2",
        "originClass": "3",
        "originLoc": "4",
        "newWeek": "5",
        "newDay": "6",
        "newClass": "7",
        "newLoc": "8",
        "type": 1,
    }
})
